﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace EzDesk.Core.Model
{
    public delegate void SendUpdateFeedsDelegate<in T>(T oldObj, T newObj, Guid actorId);
    public abstract class SendUpdateFeedsMethod
    {
        public DateTime UpdateOn { get; set; }
        public abstract void Execute();
    }

    public class SendUpdateFeedsMethod<T> : SendUpdateFeedsMethod
    {
        public SendUpdateFeedsDelegate<T> Method { get; set; }
        public T OldObject { get; set; }
        public T NewObject { get; set; }
        public Guid ActorId { get; set; }


        public override void Execute()
        {
            Method(OldObject, NewObject, ActorId);
        }
    }
}
